package com.fan.demo2;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

@ConfigurationProperties(prefix = "spring.shardingsphere")
public class ShardingSphereConfigProperties {

	/**
	 * 参与分片的数据库的别名
	 */
	private List<String> dataSourceNames;

	/**
	  * 逻辑表
	 */
	private List<String> logicTable;
	
	/**
	  * 实际参与分片的数据表
	 */
	private List<String> actualDataNodes;
	
	/**
	  * 分片键
	 */
	private List<String> shardingColumns;
	
	/**
	  * 分片策略：不同分片策略需要自定义相应的分片算法
	 */
	private List<String> shardingStrategys;
	
	/**
	  * 分片算法：可以根据配置的包路径反射来加载对应的算法实现类
	 */
	private List<String> shardingAlgorithms;

	/**
	 * 关联表：有子表关联时需要配置，避免笛卡尔积
	 */
	private List<String> bindingTableGroups;

	/**
	 * 是否显示sql
	 */
	private boolean sqlShow;

	/**
	 * 是否显示简单风格的sql，前提是sqlShow为true
	 */
	private boolean sqlSimple;

	/**
	 * 数据库主机地址
	 */
	private String host;

	/**
	 * 数据库端口
	 */
	private String port;

	/**
	 * 数据库用户名
	 */
	private String username;

	/**
	 * 数据库密码
	 */
	private String password;

	/**
	 * 数据库名称
	 */
	private String dataSourceName;
	
	public List<String> getLogicTable() {
		return logicTable;
	}

	public void setLogicTable(List<String> logicTable) {
		this.logicTable = logicTable;
	}

	public List<String> getActualDataNodes() {
		return actualDataNodes;
	}

	public void setActualDataNodes(List<String> actualDataNodes) {
		this.actualDataNodes = actualDataNodes;
	}

	public List<String> getShardingColumns() {
		return shardingColumns;
	}

	public void setShardingColumns(List<String> shardingColumns) {
		this.shardingColumns = shardingColumns;
	}

	public List<String> getShardingStrategys() {
		return shardingStrategys;
	}

	public void setShardingStrategys(List<String> shardingStrategys) {
		this.shardingStrategys = shardingStrategys;
	}

	public List<String> getShardingAlgorithms() {
		return shardingAlgorithms;
	}

	public void setShardingAlgorithms(List<String> shardingAlgorithms) {
		this.shardingAlgorithms = shardingAlgorithms;
	}

	public List<String> getBindingTableGroups() {
		return bindingTableGroups;
	}

	public void setBindingTableGroups(List<String> bindingTableGroups) {
		this.bindingTableGroups = bindingTableGroups;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getDataSourceName() {
		return dataSourceName;
	}

	public void setDataSourceName(String dataSourceName) {
		this.dataSourceName = dataSourceName;
	}

	public boolean isSqlShow() {
		return sqlShow;
	}

	public void setSqlShow(boolean sqlShow) {
		this.sqlShow = sqlShow;
	}

	public boolean isSqlSimple() {
		return sqlSimple;
	}

	public void setSqlSimple(boolean sqlSimple) {
		this.sqlSimple = sqlSimple;
	}

	public List<String> getDataSourceNames() {
		return dataSourceNames;
	}

	public void setDataSourceNames(List<String> dataSourceNames) {
		this.dataSourceNames = dataSourceNames;
	}
}
